<!DOCTYPE html>
<meta charset="utf-8">
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
test(() => {
  let canvas = document.createElement('canvas');
  canvas.width = 100;
  canvas.height = 100;
  let ctx = canvas.getContext('2d');
  let text = "اضربببببببببببببببببب";
  ctx.direction="ltr";
  let width_ltr = ctx.measureText(text).width;
  ctx.direction="rtl";
  let width_rtl = ctx.measureText(text).width;
  assert_equals(width_ltr, width_rtl);
});
</script>